<template>
  <span>{{ dictName }}</span>
</template>

<script setup>
import { useDict } from "@/hooks";

const props = defineProps({
  code: String,
  value: String,
});

const { list } = useDict(props.code);
const dictName = computed(() => {
  const item = list.value.find((i) => i.value === props.value);
  if (!item) return "";
  return item.label;
});
</script>
